package com.lan.mock15.f;

import java.util.*;


public class Main {
	
	
	static boolean check(char c) {
		return (c == 'l' || c == 'q' || c == 'b');
	}
	
	
	static boolean judge(String s) {
		int i = 0;
		int j = s.length() - 1;
		while(i < j) {
			if (s.charAt(i) == s.charAt(j)) {
				i ++;
				j --;
			} else {
				return false;
			}
		}
		return true;
	}
	
	
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int t = input.nextInt();
		for (int i = 0; i < t; i ++) {
			String s = input.next();
			
			int j = s.length() - 1;
			for (; j >= 0; j --) {
				if (check(s.charAt(j))) {
					continue;
				} else {
					break;
				}
			}
			
			String str = s.substring(0, j + 1);
			
			if (judge(str)) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		}
	}

}
